package com.cskaoyan.controller.admin.mallcontroller;

import com.cskaoyan.service.mallservice.ImageService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.mallvo.StorageVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;




/**
 * @author hsp
 * @date 2021/5/9 17:41
 */
@RestController
public class ImageUploadController {

    @Autowired
            @Qualifier("imageServiceImpOss")
    ImageService imageService;
    @RequiresPermissions("admin:storage:create")
    @RequestMapping("admin/storage/create")
    public BaseRespVo create(MultipartFile file){


        StorageVo  storageVo =  imageService.createStorage(file);

        return BaseRespVo.ok(storageVo);


    }
}
